The code in this replication package produces the tables and figures from two data sources using R. One main file runs the code to generate the data for the 1 figure and 1 table in the paper. Another file runs the code to generate the 9 figures and 6 tables in the appendix. 

The data used to conduct the analysis come from 3 waves of re-interview surveys conducted on Amazon's Mechanical Turk. The data are contained in two different forms. One dataset is in wide form, meaning that each row is an observation and the columns contain variables measured at different points in time. The other dataset is in long form, in which each row is an observation at a given wave. With 3 waves, there are 3 observations per respondent. A unique anonymous ID variable called “WorkerId2” identifies each respondent. 

The main data sources are datasets, “data_wide.csv” and “data_long.csv”. 

The .csv data used to support the findings of this study have been deposited in the PS: Political Science & Politics Dataverse repository (https://doi.org/10.7910/DVN/M34FWI). 


Descriptions of Code

- Code in analysis_main.R will read the 2 datasets; it will output Figure 1 and Table 2.

- Code in analysis_appendix.R will read the 2 datasets; it will output Figures C1-C9 and Tables A1, A2, B3, B4, B5. Table D6 was compiled by hand from the output. 


Dataset List

Information for "data_wide.csv"
Variables have suffixes indicating during which wave they were measured, but for the purposes of our study, the numbers are off by 1. Thus, “w2” is the study’s wave 1, “w3” is wave 2, and “w4” is wave 3. “APDems_4” is a 101-point feeling thermometer score toward Democrats. “outgroupThreat” is the outgroup threat scale. “democracyFaith” is the Faith in Democracy scale. “supportJan6” is the support for January 6 scale. “authoritarianActionsSelf” is the support for authoritarian actions scale. “cases” is the belief in Trump’s innocence scale. “trump_priorities” is the support for Trump’s policy priorities scale. “innocent” is the item “do you think Trump is innocent or guilty of these charges?” 

Information for "data_wide.csv"
Variables have the same names but without the suffixes. “WorkerId2” is a unique case identifier.


Instructions to Replicators

Use the “analysis_main.R” or “analysis_appendix.R” file to install the necessary packages. 

Running the code in the "analysis_main.R" file will output the figures and tables in the article. Running the code in the “analysis_appendix.R” file will output the figures and tables in the appendix. 


Software Used

R 4.4.1

readr 2.1.5
dplyr 1.1.4
tidyr 1.3.1
plm 2.6-4
lavaan 0.6-19
lmtest 0.9-40
jtools 2.3.0
texreg 1.39.4
ggpubr 0.6.0
gt 0.11.1
gtsummary 2.0.3

These versions of these packages can be installed using the install_version function in the `remotes` package in R. 

The code was last run on a 19-core M2 Pro GPU Apple laptop with 16 GB RAM running MacOS version 14.7.